package com.itheima.health.dao;

import com.github.pagehelper.Page;
import com.itheima.health.pojo.CheckItem;

import java.util.List;

/**
 * @program: health_parent
 * @description:
 * @author: HuChunping
 * @create: 2021-01-06 20:25
 **/

public interface CheckItemDao {
    /** 
    * @Description: 查询所有检查项
    * @Param: [] 
    * @return: void 
    * @Author: HuChunping 
    * @Date: 2021/1/6-20:27
    */
    List<CheckItem> findAll();

    /**
    * @Description: 添加检查项
    * @Param: [checkItem]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/7-16:00
    */
    void add(CheckItem checkItem);

    /**
    * @Description:  根据queryString分页查询
    * @Param: [queryString]
    * @return: com.github.pagehelper.Page<com.itheima.health.pojo.CheckItem>
    * @Author: HuChunping
    * @Date: 2021/1/9-18:14
    */
    Page<CheckItem> findByCondition(String queryString);

    /**
    * @Description: 通过id查询检查项
    * @Param: [id]
    * @return: com.itheima.health.pojo.CheckItem
    * @Author: HuChunping
    * @Date: 2021/1/9-18:16
    */
    CheckItem findById(int id);

    /**
    * @Description: 更新检查项
    * @Param: [checkItem]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/9-18:16
    */
    void update(CheckItem checkItem);

    /**
    * @Description:  通过中间表查询检查项的数量(据此判断是否被检查组使用)
    * @Param: [id]
    * @return: int
    * @Author: HuChunping
    * @Date: 2021/1/9-18:16
    */
    int findCountByCheckItemId(int id);

    /**
    * @Description: 通过id删除检查项
    * @Param: [id]
    * @return: void
    * @Author: HuChunping
    * @Date: 2021/1/9-18:19
    */
    void deleteById(int id);
}
